package com.situ.mall.controller;

import com.situ.mall.mapper.OrderMapper;
import com.situ.mall.pojo.Order;
import com.situ.mall.util.JSONResult;
import com.situ.mall.util.LayUITableJSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderMapper orderMapper;

    @RequestMapping("/selectAll")
    @ResponseBody
    public LayUITableJSONResult selectAll() {
        List<Order> list = orderMapper.selectAll();
        return LayUITableJSONResult.ok(10, list);
    }

    @RequestMapping("/getOrderListPage")
    public String getOrderListPage() {
        return "order_list";
    }

    @RequestMapping("/deleteById")
    @ResponseBody
    public JSONResult deleteById(Long orderNo) {
        System.out.println("orderNo: " + orderNo);
        return JSONResult.ok("删除成功");
    }
}
